Skip to content

[6.x] Fix CP auth error when using multiple user providers#14543

Merged
jasonvarga merged 3 commits intostatamic:6.xfrom
andjsch:fix-cp-auth-error
Apr 23, 2026
Merged

[6.x] Fix CP auth error when using multiple user providers#14543
jasonvarga merged 3 commits intostatamic:6.xfrom
andjsch:fix-cp-auth-error

Conversation

@andjsch
Copy link
Copy Markdown
Contributor

@andjsch andjsch commented Apr 23, 2026

When a package or an install relies on a different user provider, the redirect to the CP login fails if one attempts to access a CP page. Call to a member function preferences() on null

This is because auth()->check() doesn't explicitly check if the authenticated user is a statamic user.

 if (User::current()) {
      $this
          ->mergeDottedUserPreferences()
          ->mergeDottedRolePreferences();
  }

@jasonvarga jasonvarga merged commit 821433e into statamic:6.x Apr 23, 2026
17 checks passed
@andjsch andjsch deleted the fix-cp-auth-error branch April 23, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants